import store from '@/utils/store'
const placeholder = { name:'n-placeholder-route', render: h=> h('div',{style:'width:100%; height:100%;', class:"n-routePlaceholder"},[h('router-view')]) };

export default [
	{
		path: '/pages', 
		component: ()=> import('@/components/business/main'),
		redirect: '/pages/welcome',
		meta:{cache:1,__isLayout:1 },
		children : [
			{
				path: '/pages/home',  
				component : ()=> import( '@/views/home'),
				meta:{		
					title: '数据看板',
					icon: 'el-icon-s-home',
					cache:1,
					showFunc :()=>false
				},

			},
			{
				path: '/pages/marketing',
				component : ()=> import( '@/views/marketing'),
				meta:{
					title: '营销获客',
					icon: 'el-icon-s-platform',
					cache:1,
				},
			},
			{
				path: '/pages/service',
				component : ()=> import( '@/views/service'),
				meta:{
					title: '企业服务',
					icon: 'el-icon-service',
					cache:1,
				},
			},
			{
				path: '/pages/goods',
				component : ()=> import( '@/views/goods'),
				meta:{
					title: '营销礼品',
					icon: 'el-icon-s-goods',
					cache:1,
				},
			},
			{
				path: '/pages/article',
				component : ()=> import( '@/views/article'),
				meta:{
					title: '营销学习',
					icon: 'el-icon-document',
					cache:1,
				},
			},


			{
				path: '/pages/order',
				component : ()=> import( '@/views/order'),
				meta:{
					title: '礼品订单',
					icon: 'el-icon-s-order',
					cache:1,
					showFunc: ()=> store.userInfo && store.userInfo.type === 1
				},
			},
			{
				path: '/pages/vip',
				component : ()=> import( '@/views/vip'),
				meta:{
					title: '成为会员',
					icon: 'el-icon-coin',
					cache:1,
				},
			},



			// {
			// 	path: '/pages/service-order',
			// 	component : ()=> import( '@/views/service-order'),
			// 	meta:{
			// 		title: '企业服务订单',
			// 		icon: 'el-icon-picture-outline',
			// 		cache:1,
			// 	},
			// },
			{
				path: '/pages/data-analysis',
				component : ()=> import( '@/views/home'),
				meta:{
					title: '大数据行为分析',
					icon: 'el-icon-picture-outline',
					cache:1,
					showFunc :()=>false
				},
			},
			{
				path: '/pages/live-analysis',
				component: placeholder,
				meta:{
					__isPlaceholder:1,
					cache:1,
					title: '营销工具',
					icon: 'el-icon-picture-outline',
					showFunc :()=>false
				},
				children : [
					{
						path: '/pages/live-analysis/data',
						component : ()=> import( '@/views/live-analysis/data'),
						meta:{
							cache:1,
							title: '直播数据分析',
							icon: 'el-icon-picture-outline',
						},
					},
					{
						path: '/pages/live-analysis/keyword',
						component : ()=> import( '@/views/live-analysis/keyword'),
						meta:{
							cache:1,
							title: '关键词分析',
							icon: 'el-icon-picture-outline',
						},
					},
					{
						path: '/pages/live-analysis/database',
						component : ()=> import( '@/views/live-analysis/database'),
						meta:{
							cache:1,
							title: '数据库',
							icon: 'el-icon-picture-outline',
						},
					},
				]
			},
			{
				path: '/pages/user',  
				component : ()=> import( '@/views/user'),
				meta:{		
					title: '用户管理',
					icon: 'el-icon-user-solid',
					cache:1,
					showFunc: ()=> (store.userInfo && store.userInfo.type === 1) || (store.userInfo && store.userInfo.type === 4)
				},
			},
			{
				path: '/pages/me',
				component : ()=> import( '@/views/me'),
				meta:{
					title: '系统设置',
					icon: 'el-icon-s-tools',
					cache:1,
					showFunc: ()=> store.userInfo && store.userInfo.type === 1
				},
			},
			// {
			// 	path: '/pages/add-account',
			// 	component : ()=> import( '@/views/home'),
			// 	meta:{
			// 		title: '添加目标账号',
			// 		icon: 'el-icon-picture-outline',
			// 		cache:1,
			// 	},
			// },
		]
	}
	
]
 